package com.gitee.cashzhang.test.basic.method;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/05/08 13:47
 */
public class TryCatch {

  public static void main(String[] args) {
    System.out.println(test());
  }

  public static int test() {
    int i = 1;
    try {
      System.out.println(1);
//      int j = 1 / 0;
      System.out.println(2);
      return i + 1;
    } catch (ArithmeticException e) {
      e.printStackTrace();
    } finally {
      System.out.println(3);
      return i + 2;
    }
  }
}
